<template>

  <a-locale-provider :locale="locale">
    <div>
      <FormDefinitionEditor :formDefinition="formDefinition" @change="formDefinitionChange"/>
    </div>
<!--    <div>-->

<!--      <FormEngine :view="viewId" v-model="formModel" :formDefinition="formDefinition">-->
<!--      </FormEngine>-->

<!--      <a-select style="width: 200px;" v-model="viewId">-->
<!--        <a-select-option v-for="view in (formDefinition && formDefinition.views || [])" :value="view.id">-->
<!--          {{ view.viewName }}-->
<!--        </a-select-option>-->
<!--      </a-select>-->
<!--    </div>-->
  </a-locale-provider>
</template>
<script>
import FormDefinitionEditor from "@/components/FormDefinitionEditor/FormDefinitionEditor.vue";
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
import FormEngine from "@/components/FormEngine/FormEngine.vue";
import formDefinition from '@/components/data/formDefinition.json'
import {globalData} from "@/utils";

export default {
  name: 'App',
  components: {FormEngine, FormDefinitionEditor},
  data() {
    return {
      formDefinition: JSON.parse(JSON.stringify(formDefinition)),
      locale: zhCN,
      formModel: undefined,
      viewId: '456',
    }
  },
  mounted() {
    globalData.h = this.$createElement;
  },
  methods: {
    formDefinitionChange() {
    },
  }
};
</script>